import "codemirror/theme/idea.css";
import "codemirror/lib/codemirror.css";
import "codemirror/mode/javascript/javascript";

import "codemirror/addon/hint/javascript-hint";
import "codemirror/addon/hint/show-hint"
import "codemirror/addon/hint/show-hint.css"


import CodeMirror from "codemirror";

CodeMirror(document.getElementById("code"), {
    value: "function myScript(){return 100;}\n",
    mode: "javascript",
    theme: "idea",
    lineNumbers: true,
    smartIndent: true,
    extraKeys: {
        "Tab": "autocomplete"
    }
});

(function(){
    let bp = document.createElement('script');
    let curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    let s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();

